{include file="header.tpl" frontpage=1}
{strip}
<div class="section">
	<h2>Favorieten</h2>
	<table class="favorites" id="favorites" cellspacing="0">
		<tr>
			<td class="noresults">Je hebt nog geen favoriete teams of spelers toegevoegd</td>
		</tr>
	</table>
</div>

<div class="section">
	<h2>Komende wedstrijden</h2>
	<table class="schedule" cellspacing="0">
	{assign var="lastLocation" value="-"}
	{assign var="lastDate" value="-"}
	
	{foreach from=$plannedGames item="oGame" name="schedule"}
		{if !($oGame->date == $lastDate && $oGame->location_nefub_id == $lastLocation)}
		<tr>	
			{if $oGame->date != $lastDate}	
			<td class="greenLeft">				
				<a href="/agenda/{$oGame->date|date_format:"%d-%m-%Y"}"><small>{$oGame->date|date_format:"%a"|ucfirst}</small><br />
				{$oGame->date|date_format:"%e %b"}</a>
			</td>
			{else}
			<td class="greenLeft continue"></td>
			{/if}
			<td>
				<a href="/locatie/{$oGame->location_nefub_id}#datum_{$oGame->date|date_format:"%d-%m-%Y"}"><h4>{$oGame->getLocation()->name|replace:' ':'&nbsp;'}, {$oGame->getLocation()->city|replace:' ':'&nbsp;'}</h4>
				{$oGame->getCompetition()->name|replace:' ':'&nbsp;'}
			
		{elseif $oGame->date == $lastDate}
		, {$oGame->getCompetition()->name|replace:' ':'&nbsp;'}
		{else}</a>
			</td>
			</tr>
		{/if}		
		
		{if $smarty.foreach.schedule.last}				
				<tr>
					<td colspan="3" class="meer">
						<a href="/agenda">Naar alle komende wedstrijden</a>
					</td>
				</tr>
		{/if}
		{assign var="lastDate" value=$oGame->date}	
		{assign var="lastLocation" value=$oGame->location_nefub_id}	
	{foreachelse}
		<tr>
			<td colspan="3" class="noresults">
				Er zijn geen wedstrijden gepland
			</td>
		</tr>	
	{/foreach}
	</table>
</div>

<div class="section">
	<h2>Recente uitslagen</h2>
	<table class="results" cellspacing="0">
	{assign var="lastDate" value="-"}
	{foreach from=$aResultGames key="date" item="oGame" name="recentgames"}
				
			{if $lastDate == $oGame->date}								
				{include file="row.game.uitslag.tpl" oGame=$oGame sameDate="1" extraClass=$plannedGameClass showCompetition=1}
			{else}
				{include file="row.game.uitslag.tpl" oGame=$oGame extraClass=$plannedGameClass showCompetition=1}
			{/if}
			{assign var="lastDate"  value=$oGame->date}
		{if $smarty.foreach.recentgames.last}				
				<tr>
					<td colspan="3" class="meer">
						<a href="/uitslagen">Naar alle uitslagen</a>
					</td>
				</tr>
		{/if}
		{assign var="plannedGameIteration" value=$plannedGameIteration+1}
	{foreachelse}
		<tr>
			<td colspan="3" class="noresults">
				Er zijn geen uitslagen beschikbaar
			</td>
		</tr>	
	{/foreach}
		
	</table>
</div>
{/strip}

<div class="section">
	<h2>Standen</h2>
	<table class="competitions">
	{assign var="lastGender" value=""}	
	{assign var="lastGenre" value=""}	
	{foreach from=$aCompetitions item="oCompetition"}		
		<tr>
			<td class="greenLeft{if $lastGenre == $oCompetition->genre_id && $lastGender == $oCompetition->gender_id} continue{else} {$oCompetition->getGender()->nefub_name|lower} {$oCompetition->getGenre()->nefub_name|lower}{/if}">
			{if $lastGenre != $oCompetition->genre_id || $lastGender != $oCompetition->gender_id} 
				<div class="competitionIcons">
					<div class="competitionIcon left">&nbsp;</div>			
					<div class="competitionIcon right">&nbsp;</div>
					<div class="clear"><!--  --></div>			
				</div>
			{/if}
			</td>
			<td>
				<a href="/competitie/{$oCompetition->nefub_id}"><h4>{$oCompetition->name}</h4></a></h4>
			</td>
		</tr>	
		{assign var="lastGender" value=$oCompetition->gender_id}	
		{assign var="lastGenre" value=$oCompetition->genre_id}	
	{foreachelse}
		<tr>
			<td colspan="3" class="noresults">
				Er zijn geen standen beschikbaar
			</td>
		</tr>	
	{/foreach}
	
	</table>
</div>
{include file="footer.tpl"}
